﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;

namespace BUS
{
    public class NguyenVatLieuBUS
    {
        public static List<NguyenVatLieuDTO> SelectAll()
        {
            return NguyenVatLieuDAO.SelectAll();
        }

        public static List<NguyenVatLieuDTO> Select_by_MaNCC(int MaNCC)
        {
            return NguyenVatLieuDAO.Select_by_MaNCC(MaNCC);
        }

        public static List<NguyenVatLieuDTO> Select_NVL_not_exits_in_NCC(int MaNCC)
        {
            return NguyenVatLieuDAO.Select_NVL_not_exits_in_NCC(MaNCC);
        }

        public static bool Delete_NVL_from_NCC(int ID_NCC_NVL)
        {
            return NguyenVatLieuDAO.Delete_NVL_from_NCC(ID_NCC_NVL);
        }

        public static bool Insert_NVL_for_NCC(int NVL, int NCC, string DonGia)
        {
            return NguyenVatLieuDAO.Insert_NVL_for_NCC(NVL, NCC, DonGia);
        }

        public static bool Insert(NguyenVatLieuDTO nvl)
        {
            try
            {
                return NguyenVatLieuDAO.Insert(nvl);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static bool Update(NguyenVatLieuDTO nvl)
        {
            try
            {
                return NguyenVatLieuDAO.Update(nvl);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static bool Delete(int MaNVL)
        {
            try
            {
                return NguyenVatLieuDAO.Delete(MaNVL);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static bool Insert_SoLuong(NguyenVatLieuDTO nvl)
        {
            try
            {
                return NguyenVatLieuDAO.Insert_SoLuong(nvl);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static bool Update_SoLuong(NguyenVatLieuDTO nvl)
        {
            try
            {
                return NguyenVatLieuDAO.Update_SoLuong(nvl);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
